package Practice;

import java.util.Scanner;
class Students{
    String name;
    int age;
    int grade;

    public Students(String name, int age, int grade) {
        this.name = name;
        this.age = age;
        this.grade = grade;
    }


}

public class Training {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Students[] s = new Students[n];
        for (int i = 0; i < n; i++) {
            String name = sc.next();
            int age = sc.nextInt();
            int grade = sc.nextInt();
            s[i] = new Students(name,age,grade);
        }

        for (Students stu : s){
            stu.age += 1;
            stu.grade = Math.min(600, stu.grade*6/5);
            System.out.println(stu.name+" "+stu.age+" "+stu.grade);
        }

    }
}
